Annoying Javascript Behavior when hitting ESC on this Website
Original Post
I have been a reader of this website for the past few months.
I frequently use my browser's find feature in order to search to specific pieces of text, I do this for various reasons, it's one of the ways I read, compare what people said, and so on.
I typically hit ESC after I'm done my text-searching, in order to get rid of my distracting find box.
Unfortunately this website attempts to redirect me to the login page every time I hit ESC.
This behavior is caused by this source code:
\
Does anyone here regularly hit the ESC key for whatever reason and find this behavior annoying?
I frequently use my browser's find feature in order to search to specific pieces of text, I do this for various reasons, it's one of the ways I read, compare what people said, and so on.
I typically hit ESC after I'm done my text-searching, in order to get rid of my distracting find box.
Unfortunately this website attempts to redirect me to the login page every time I hit ESC.
This behavior is caused by this source code:
\
Does anyone here regularly hit the ESC key for whatever reason and find this behavior annoying?
Reply by Andreas Hofmann
Heh, never noticed this. I've got thrown once or twice to the login page without knowing why, but I don't use the Esc key to close my find bar - I use the "Hide Find Bar" addon to have it disappear automatically after 10 seconds not in use (time is adjustable). Might be an alternative for you, because I don't think (pardon me if I'm wrong) that Mark is tech-savvy enough to solve this problem. It's probably part of the standard squarespace package. I'm not even sure their support will change that if he asks them to. ^_^
Second do-it-yourself solution: write a user-javascript to cancel the esc key hook on this page.
Second do-it-yourself solution: write a user-javascript to cancel the esc key hook on this page.
Reply by Mark Forster
JIm and Andreas:
I hadn't noticed this behaviour myself because it doesn't happen when one is logged in (which I normally am).
I'll take it up with Squarespace.
I hadn't noticed this behaviour myself because it doesn't happen when one is logged in (which I normally am).
I'll take it up with Squarespace.
Reply by Andreas Hofmann
In the meantime, you can use this script to block the esc key behaviour: http://autofocus.cc/public/data/greasemonkey/markforsternet_remove_es.user.js
To use it, you need either Firefox with Greasemonkey https://addons.mozilla.org/en-US/firefox/addon/748 or a browser that supports userscripts natively, like Opera.
Then just click on the link above and say yes to the question if you want to install it. After that, pressing Esc will no longer take you to the login page.
PS: Writing this script also reminded me of my other script for markforster.net which changes the links in the forum overview to always take you directly to the last page of a discussion: autofocus.cc/public/data/greasemonkey/markforsternet_forum_lastpage.user.js
To use it, you need either Firefox with Greasemonkey https://addons.mozilla.org/en-US/firefox/addon/748 or a browser that supports userscripts natively, like Opera.
Then just click on the link above and say yes to the question if you want to install it. After that, pressing Esc will no longer take you to the login page.
PS: Writing this script also reminded me of my other script for markforster.net which changes the links in the forum overview to always take you directly to the last page of a discussion: autofocus.cc/public/data/greasemonkey/markforsternet_forum_lastpage.user.js
Reply by Andreas Hofmann
Okay, I just did some testing. In Firefox with Greasemonkey and Google Chrome (Version 4.0), you can just click the above link and it works. In Opera, you first need to set a userscript directory in the preferences, then download the script to that directory, then it works.
And I forgot the "http://" in the link to my other script: http://autofocus.cc/public/data/greasemonkey/markforsternet_forum_lastpage.user.js
And I forgot the "http://" in the link to my other script: http://autofocus.cc/public/data/greasemonkey/markforsternet_forum_lastpage.user.js
Reply by Mark Forster
Reply from Squarespace:
Yes, the ESC to login is a shortcut key to access your login page. This is a shortcut to help for those times when you might delete a login page and need a back-up login option, or just an option without having to actually keep a login page on the site.
Yes, the ESC to login is a shortcut key to access your login page. This is a shortcut to help for those times when you might delete a login page and need a back-up login option, or just an option without having to actually keep a login page on the site.
Reply by Andreas Hofmann
So I gather they won't "fix" this feature? Well, the time I spent putting together that little script together seems less wasted now. :-)
Reply by Brian
Thanks Andreas, I've added it along side your lastPage script, which I have been using since you first published it.